@echo off
if NOT exist "%2" goto :usage
set INPUT=%1
set OUTPUT=%2

set MODE=LR
if "%3" ==  "mix" set MODE="MIX"

echo -- INPUT  = %INPUT%
sox %INPUT% -n stats

echo -- MODE   = %MODE%

if "%MODE%" == "LR" sox %INPUT% %OUTPUT% remix 1 2 
if "%MODE%" == "MIX" sox %INPUT% %OUTPUT% remix 1,3,4,5 2,3,4,6

echo -- OUTPUT = %OUTPUT%
sox %OUTPUT% -n stats
goto :end



:usage
echo -- %0 -- DCPscripts - by Peter Forret --
echo -- Effect: reduce a 6-channel (5.1) WAV file to a 2 channel (stereo) WAV
echo -- Usage:  %0 [INPUT WAV] [OUTPUT WAV] [OPTION]
echo --         [OPTION] = lr  - only take channels 1+2 (default)
echo --         [OPTION] = mix - mix 6 channels to 2


:end